<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="common/include :: header('修改员工')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">

		<form class="form-horizontal m" id="form-employee-edit" th:object="${employee}">
			<input id="employeeId" name="employeeId" type="hidden" th:field="*{id}"/>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">员工名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="name" id="employeeName" th:field="*{name}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">员工邮箱：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="email" id="email" th:field="*{email}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label is-required">显示年龄：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="age" id="age" th:field="*{age}" required>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">员工状态：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('isStatus')}">
						<input type="radio" th:id="${dict.id}" name="status" th:value="${dict.value}" th:field="*{status}">
						<label th:for="${dict.id}" th:text="${dict.label}"></label>
					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">是否管理员：</label>
				<div class="col-sm-8">
					<div class="radio-box" th:each="dict : ${@dict.getType('isAdmin')}">
						<input type="radio" th:id="${dict.id}" name="admin" th:value="${dict.value}" th:field="*{admin}">
						<label th:for="${dict.id}" th:text="${dict.label}"></label>
					</div>
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label">时间：</label>
				<div class="col-sm-8">
					<input name="hiredate"  th:value="${#dates.format(employee.hiredate, 'yyyy-MM-dd HH:mm')}"
						   class="form-control" type="text"  >
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-3 control-label is-required">部门：</label>
				<div class="col-sm-8">
					<select name="deptId" class="form-control m-b" th:with="type=${@dict.getType('deptId')}" required>
						<option th:each="dict : ${type}" th:text="${dict.label}" th:value="${dict.value}" th:field="*{deptId}"></option>
					</select>
				</div>
			</div>

		</form>
	</div>
	<th:block th:include="common/include :: footer" />
	<th:block th:include="common/include :: datetimepicker" />
	<script type="text/javascript">
		var prefix = ctx + "/business/employee";

		$("input[name='hiredate']").datetimepicker({
			format: "yyyy-mm-dd hh:mm",
			autoclose: true
		});


		
		function submitHandler() {
	        if ($.validate.form()) {
	        	$.operate.save(prefix + "/edit", $('#form-employee-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
